package com.ydm.fire_fighting_web.exception;


import com.ydm.fire_fighting_web.exception.response.ResultCode;

public class CustomException extends RuntimeException {
    //定义resultCode接口
    private ResultCode resultCode;

    public CustomException(ResultCode resultCode){
        //异常信息为错误代码+异常信息
        super("错误代码："+resultCode.code()+"错误信息："+resultCode.message());
        this.resultCode = resultCode;
    }

    /**
     * 返回异常信息
     * @return
     */
    public ResultCode getResultCode(){
        return this.resultCode;
    }
}
